#ifndef ESDL_mouse_h
#define ESDL_mouse_h

#include <SDL/SDL_mouse.h>
#include <stdbool.h>

/** 
 * @struct Mouse
 * @brief Mouse structure
 */
typedef struct EsdlMouse EsdlMouse;

struct EsdlMouse {
    unsigned int x; //!< X position on the screen
    unsigned int y; //!< Y position on the screen
    bool buttons[8]; //!< State of the buttons (true=pressed or false=unpressed)
    bool show; //!< Flag. true if the cursor is shown
    bool glue; //!< Flag. true if the cursor is glued
};

/**
 * @enum MouseButton
 * @brief MouseButton enumeration
 */
typedef enum EsdlMouseButton {
    MOUSE_BUTTON_LEFT = SDL_BUTTON_LEFT,
    MOUSE_BUTTON_MIDDLE = SDL_BUTTON_MIDDLE,
    MOUSE_BUTTON_RIGHT = SDL_BUTTON_RIGHT,
    MOUSE_BUTTON_WHEEL_UP = SDL_BUTTON_WHEELUP,
    MOUSE_BUTTON_WHEEL_DOWN = SDL_BUTTON_WHEELDOWN,
    MOUSE_BUTTON_X1 = SDL_BUTTON_X1,
    MOUSE_BUTTON_X2 = SDL_BUTTON_X2
} EsdlMouseButton;


/**
 * @param MouseButton button - 
 * @return true if the mouse button is pressed
 */
bool esdlIsMouseButtonPressed(EsdlMouseButton button);

/**
 * @brief Show the mouse cursor
 */
void esdlShowMouseCursor();

/**
 * @brief Hide the mouse cursor
 */
void esdlHideMouseCursor();

/**
 * @brief Glue the cursor on the center of the window
 * @param bool glue - If true, glue the cursor. Else release it.
 */
void esdlGlueMouse(bool glue);

#endif

